class A_SELECT{ETP,ATP< $ARR{ETP}}
****
Basic algorithms for order statistics Most of these algorithms MODIFY THE ORIGINAL ARRAY!


Flattened version is here

Ancestors
COMPARE{_}



Public


Features
median_modifying(a: ATP): ETP
**** The median of the elements contained in 'a' according to the ordering relation `elt_lt'. Permutes the elements of 'a'. Void if self is empty
select_modifying(a: ATP,i:INT,lp,up: INT): ETP
**** Modifies "a" Move the elements of a so that the element with index `i' is not `elt_lt' any element with lower indices and no element with a larger index is `elt_lt' it. Use the subarray in the range l,u Return the "ith" element in the rearranged array
select_modifying(a:ATP,lt:ROUT{ETP,ETP}:BOOL, i:INT,lp,up: INT):ETP
**** Modifies 'a' Move the elements of 'a' so that the element with index `i' is not `lt' any element with lower indices and no element with a larger index is `lt' it.


Private

check_index(a: ATP,i: INT,l,u: INT): BOOL
swap(a: ATP,order: ARRAY{INT},i,j: INT)
swap(a: ATP,i,j: INT)

The Sather Home Page